<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title></title>
<link href="doyo/admin/template/style/admin.css" rel="stylesheet" type="text/css" />
<script src="include/js/jquery.js" type="text/javascript"></script>
<script src="include/js/xheditor/xheditor-zh-cn.min.js" charset="utf-8" type="text/javascript"></script>
<script type="text/javascript">
$(function(){
	fieldsinfo();
	$("#type").change(function(){
		fieldsinfo();
	});
});
function fieldsinfo(){
	if($("#type").attr("value")==1){
		$('#body').xheditor(false);
		$('#body').css('height','200');
	}
	if($("#type").attr("value")==2){
		$('#body').css('height','320');
		$('#body').xheditor({html5Upload:false,upLinkUrl:'!doyo.php?c=uploads&a=loadup&fileover=2&isfiles=filedata',upImgUrl:'!doyo.php?c=uploads&a=loadup&fileover=2&multi=1&isfiles=filedata&fileExt=*.jpg;*.jpeg;*.gif;*.png',upFlashUrl:'!doyo.php?c=uploads&a=loadup&fileover=2&isfiles=filedata',upMediaUrl:'!doyo.php?c=uploads&a=loadup&fileover=2&isfiles=filedata'});
	}
}
</script>
</head>

<body>
<div class="maintop">当前位置：<?php echo $toptxt ?></div>
<?php if($postgo){ ?>
<div class="main"><div class="oper"><a href="?c=a_labelcus">编辑标签</a><a href="?c=a_labelcus&a=add">添加标签</a></div>
	<div class="info">
    <form action="?c=a_labelcus&a=<?php echo $postgo ?>&run=1" method="post">
    <input name="id" type="hidden" value="<?php echo $d['id'] ?>" />
    <dl><dt>标签名称：</dt><dd><input name="name" type="text" class="int" value="<?php echo $d['name'] ?>" /></dd></dl>
    <dl><dt>内容格式：</dt><dd><select name="type" id="type">
      <option value="1"<?php if($d['type']==1)echo ' selected="selected"'; ?>>文本</option>
      <option value="2"<?php if($d['type']==2)echo ' selected="selected"'; ?>>带编辑器文本</option>
    </select></dd></dl>
    <dl><dt>标签内容：</dt><dd><textarea name='body' id='body' class="int" style='width:600px;'><?php echo $d['body'] ?></textarea></dd></dl>
    <dl><dt>&nbsp;</dt><dd class="t">标签内容可使用html代码</dd></dl>
    <dl><dt>&nbsp;</dt><dd><input type="submit" value="提 交" class="btnbig" /></dd></dl>
    </form>
    </div>
</div>
<?php }else{ ?>
<div class="main"><div class="oper"><a href="?c=a_labelcus">编辑标签</a><a href="?c=a_labelcus&a=add">添加标签</a></div>
<table width="100%" class="tablist">
  <tr class="trbg">
    <td width="40">ID</td>
    <td>标签名称</td>
    <td>调用方法</td>
    <td width="120">操作</td>
  </tr>
<?php foreach($lists as $v){ ?>
  <tr>
    <td><?php echo $v['id']; ?></td>
    <td class="tdleft"><a href="?c=a_labelcus&a=edit&id=<?php echo $v['id']; ?>"><?php echo $v['name']; ?></a></td>
    <td class="tdleft"><?php echo "标签名称： <span style='color:#C00'>{fun labelcus(".$v['id'].",'name')}</span>&nbsp;&nbsp;标签内容： <span style='color:#C00'>{fun labelcus(".$v['id'].",'body')}</span>"; ?></td>
    <td><a href="?c=a_labelcus&a=edit&id=<?php echo $v['id']; ?>">编辑</a>&nbsp;&nbsp;<a href="?c=a_labelcus&a=del&id=<?php echo $v['id']; ?>">删除</a></td>
  </tr>
<?php } ?>
</table>
</div>
<?php } ?>
</body>
</html>
